home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c
- Path: novice.uwaterloo.ca!lhuang
- From: lhuang@swen3.uwaterloo.ca (Larry Huang)
- Subject: Re: size_t
- Message-ID: <DM48Fv.5Ay@novice.uwaterloo.ca>
- Sender: lhuang@swen.uwaterloo.ca
- Date: Thu, 1 Feb 1996 21:16:43 GMT
- Nntp-Posting-Host: swen.uwaterloo.ca
- Organization: University of Waterloo
-
- I was writing some code to manage a table the other day. I used
- a size_t to keep track of the size of the table, and I defined a
- macro SIZE_T_MAX as (size_t)(-1) for making sure the table doesn't
- get too large. Then I suddenly realize that it may not work as
- I thought. An implementation can restrict the size of a data
- object to 32 K (is my memory correct here?), but the value of
- (size_t)(-1) can at the same time be very large (e.g. ULONG_MAX).
- So my question is, is there a way to find out what the maximum
- allowable size of a data object is under an implementation?
-
- Larry
-
-
-